1. Field of the Invention
The present invention relates to a motion vector prediction method, and more particularly, to a motion vector prediction method in an error resilient mode.
2. Description of the Related Art
In general, redundancy of a moving picture must be effectively eliminated so as to compress the moving image. The moving picture experts group (MPEG) adopts a motion prediction method. According to the motion prediction method, the current frame is divided into a plurality of macro blocks, and then each macro block (reference block) is compared with each macro block (matching block) of a previous frame within a given area, to calculate the difference therebetween. Then, the macro blocks having the lowest difference are selected to calculate motion vectors representing the difference in positions between the reference and matching blocks. In the motion vector prediction, the difference between a predicted motion vector and actual motion vector of the current block is encoded, in place of encoding the motion vector itself of the current block, thereby improving coding efficiency.
FIG. 1 is a diagram illustrating a conventional motion prediction method and coding sequence adopted in the MPEG-4 and the H.263 standards.
In FIG. 1, reference numerals 10 through 18 represent macro blocks each consisting of 16 pixelsxc3x9716 pixels, reference numerals 10 and 16 are macro blocks each having one motion vector, and reference numerals 12, 14 and 18 represents macro blocks each 10 having four motion vectors. The macro blocks 12, 14 and 18 are divided into four subblocks of 8 pixelsxc3x978 pixels, based on the MPEG-4 or the H.263 standard, and those four motion vectors are calculated from the four subblocks.
Here, prior to transmission of the difference among each 15 motion vector, motion vector prediction is separately performed in upper subblocks 121, 122, 141 and 142 and lower subblocks 123, 124, 143 and 144 of the macro blocks 12 and 14 from the macro block 10 in a solid arrow direction. Here, a motion vector is predicted from motion vectors calculated in the upper subblock 142, the macro blocks 16 and the subblocks 181 through 184 of the macro block 18 with correlation. However, the motion vector prediction is not performed between the motion vectors of the subblock 144 and the macro block 16, and the motion vector prediction continues toward the lower subblocks 183 and 184 from the macro block 16.
Thus, if an error occurs, the motion vector can be decoded from the macro block 16 toward the upper subblock 142 in a backward direction. However, if an error occurs in the lower subblock 123 of the macro block 12, it is not possible to reversely calculate the motion vectors of the subblock 144 and its left subblock 143 from the macro block 16 using a motion vector prediction code.
As a result, it is not possible to decode the blocks following the erroneous block, thereby increasing loss in motion vector value. Although an error concealment is adopted, there is a problem of loss of information.
To solve the above problems, it is an object of the present invention to provide a motion vector prediction method capable of restoring a motion vector lost after an error occurs, through backward decoding, even when information is lost during transmission due to the error.
Accordingly, to achieve the above object, there is provided a motion vector prediction method capable of decoding backwards, comprising the steps of: (a) calculating motion vectors of macro blocks; and (b) predicting motion vectors of macro blocks each having one motion vector while moving to another macro block from left to right, and motion vectors of macro blocks each having four motion vectors continuously in a predetermined sequence to have correlation in prediction of the four motion vectors.
Preferably, in the step (b) when one macro block has one motion vector, the motion vector prediction of the current block is performed using the motion vector of the macro block on the left of the current block or the previous coded macro block.
Preferably, in the step (b) when one macro block has four motion vectors, the motion vectors are continuously predicted from the motion vectors of the upper-left, lower-left, lower-right and upper-right subblocks in sequence.